getApp();

Page({
    data: {},
    onLoad: function(e) {
        var n = Date.parse(new Date()) + 5e3;
        wx.setStorageSync("index_data_expiration", n);
    },
    onReady: function() {},
    onShow: function() {
        if (wx.getStorageSync("index_data_expiration") < Date.parse(new Date())) return console.log("缓存已过期"), 
        wx.clearStorageSync(), void wx.redirectTo({
            url: "../index"
        });
    },
    onHide: function() {},
    onUnload: function() {
        var e = getCurrentPages();
        e[e.length - 2].clear();
    },
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {
        return {
            path: "pages/index"
        };
    },
    callNum: function(e) {
        var n = e.currentTarget.dataset.num;
        wx.showActionSheet({
            itemList: [ "呼叫：" + n ],
            success: function(e) {
                wx.makePhoneCall({
                    phoneNumber: n
                });
            }
        });
    },
    yztcClick: function() {
        wx.navigateTo({
            url: "/pages/webview/webview"
        });
    }
});